<template>
  <div class="col-xs-offset-2 col-xs-8">
    <div class="page-header"><h2>Vue Router Demo</h2></div>
    <button @click="back">后退</button>
    <button @click="forward">前进</button>
    <button @click="testGo">测试一下GO</button>
  </div>
</template>

<script>
export default {
  name:'Banner',
  methods:{
    // 前进
    back(){
      this.$router.back()
    },
    // 后退
    forward(){
      this.$router.forward()
    },
    testGo(){
      // 参数为正数前进(back)，复数则后退(forward)
      this.$router.go(2)
    }
  }

}
</script>

<style>

</style>